Skip to main content

Patterns

  • Event Notification
    • Customer Service -> User Change Address Event <- Insurance Service consumes
    • Tradeoff: Decouple receiver from sender but No statement of overall behavior as everything is decoupled
  • Event-Carried State Transfer
    • All the event details are stored within the Event
    • Tradeoff: High decoupling high availability but eventual consistency
  • Event-Sourcing
    • Stores all the events as logs, ability to playback all the events. Ability to change the past and tweak events put in a different system and replay everything from a point
    • Tradeoff: Unfamiliar, External Systems dependencies on events, Event schema and Versioning
      • Internal Event versus External Event. For example if i change a price of a widget, if I've already published it externally and internally it was processed differently it will cause discrepancies
    • Sample: Git
  • CQRS - Command Query Responsibility Segregation
    • Query Model vs Command Model -> Seperate Components
    • Complicated Business case
    • Tradeoff: Be careful alot get in trouble,
    • Sample: Operational Database and Reporting Database

Concepts

  • Events or Commands
    • Communication pattern has implications
    • Event - notifying a change an event has happened and i don't care what really happens
    • Command - explicitly expecting a reaction or an action from another servicei